//
//  MSSearchHistoryCell.m
//  SocietySale
//
//  Created by Mike on 16/11/9.
//  Copyright © 2016年 Mike. All rights reserved.
//

#import "MSSearchHistoryCell.h"

@implementation MSSearchHistoryCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initView];
    }
    return self;
}

- (void)initView {
    UIButton *deleteBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    deleteBtn.frame = CGRectMake(SCREEN_WIDTH-54, 0, 44, 44);
    [deleteBtn setImage:[UIImage imageNamed:@"close1"] forState:UIControlStateNormal];
    [deleteBtn addTarget:self action:@selector(deleteClick) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:deleteBtn];
    
    _horizonLineView =[[UIView alloc] initWithFrame:CGRectMake(12, 49.4, SCREEN_WIDTH-24, 0.6)];
    _horizonLineView.backgroundColor = kNormalGray;
    [self.contentView addSubview:_horizonLineView];
}

- (void)deleteClick{
    if (self.delegate && [self.delegate respondsToSelector:@selector(deleteCurrentHistoty:)]) {
        [self.delegate deleteCurrentHistoty:self.index];
    }
}

@end
